import store from '@/store/index'
export default {
  install(Vue) {
    Vue.directive('allow', {
      inserted: function(el, binding) {
        if (
          !store.state.user.userInfo.data.roles.points.includes(binding.value)
        ) {
          console.log(el, '不可见')
          el.parentNode.removeChild(el)
        } else {
          console.log('可见')
        }
      }
    })
  }
}

/* export default {
  install(Vue) {
    Vue.directive('allow', {
      inserted: function(el, binging) {
        const points = store.state.user.userInfo.roles.points
        if (!points.includes(binging.value)) {
          el.parentNode.removeChild(el)
        } else {
          console.log('显示')
        }
      }
    })
  }
} */
